home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / programming / assembly / lsd-lo.s.lha / MultiDiskFileLoader.Docs < prev    next >
Encoding:
Text File  |  1980-01-15  |  5.6 KB  |  140 lines

  1.  
  2.        No System Multi Disk File Loader V1.1 - By Phil!94 - 26-4-94
  3.        ------------------------------------------------------------
  4.  
  5. * Wanna contact me? I'm at:- 43 Fairholme Rd,
  6.                              Hodge Hill,
  7.                              Birmingham,
  8.                              B36 8HN.
  9.                              England.
  10.  
  11. This Routine allows you to load AmigaDos standard binary files without
  12. using the ROM system software at all. You give the location of the
  13. filename and where in ram you want the file loaded and the code does the
  14. rest! In this MULTI-DISK version, you should include a path name in your
  15. filename string - This can be either to directly access a drive (DF0:
  16. DF1: etc) or to access a named disk (PHILSDISK:, DISKMAG DISK 2: etc) in
  17. which case all available drives will be checked for the presence of the
  18. specified disk. Full error return codes are given upon return from the
  19. load call.
  20.  
  21. The code will let you load files from within subdirectories by simply
  22. adhering to the standard amiga syntax in file names. Eg:to load the file
  23. "Turkey" in directory "FOWL", the filename should be:"FOWL/TURKEY,($00)"
  24. However dont use any fancy wildcards in the filenames etc. Upper/lower
  25. case characters are treated as the same character.
  26.  
  27. LOADING A FILE
  28. --------------
  29.  
  30. Before you load for the 1st ever time - Call "DISK_INIT"!!!
  31. You never have to call this again - not even after you shut down the motor.
  32.  
  33. To load a file just set A5,A6 AND D7 as shown:-
  34.  
  35. SET A5 = Load address. This will return as last byte address of file+1 if
  36.          load succesful - make even aligned for 68000 compatibility.
  37.  
  38. SET A6 = Location of zero-terminated filename ascii string.
  39.  
  40. SET D7 = Mode of Operation :
  41.  
  42.          00 = Normal load.
  43.          01 = Search, and return file length (if found) in A5 only.
  44.                             
  45. Then JSR / BSR 'FILE_LOAD' - All registers are saved except A5 as explained
  46. above and D7 which returns 00 if load successful or one of these reports:-
  47.  
  48.  01 = No speed signal from motor      (ejected disk whilst loading?)
  49.  02 = No DMA transfer - time out      (bad disk / ''           ''  )
  50.  03 = Disk ejected.                   (whilst loading)
  51.  04 = Can't find that disk block      (disk corrupt)
  52.  05 = Wrong track marker ID           ('')
  53.  06 = Checksum error on disk block    ('')
  54.  07 = Block number out of range       ('')
  55.  08 = Not a file specifed             (thats a directory!)
  56.  09 = File not found.                 (obvious!)
  57.  0a = That drive is not connected.    (Direct drive access failed)
  58.  0b = There is no disk in that drive. ( ''                    '' )
  59.  0c = Disk requester.                 (Disk specified not in any drive)
  60.  0d = No path given                   (I require disk or drive name!)
  61.  
  62. If error report occurs, its up to you to display an appropiate message
  63. (or disk requester in the case of error $0C).. You can then if you want
  64. jump straight back to your 'set-registers and call load' bit of code as
  65. the program switches off the drive, and waits 1 second before exit.IE: It
  66. does things properly NOT leaving the motor running for example! Actual
  67. MFM (disk corrupt) errors are only returned after the program has tried
  68. to re-read the dodgey track 12 times! - during which time it will have
  69. reset the disk head etc in case of alignment problems.
  70.  
  71. Example filenames:                 Errors that may occur:
  72.  
  73.  "DF1:cobblers",$0               - Error $a if df1: not connected
  74.  "PHILS_TOSH:textfile/coding",$0 - Error $c if PHILS_TOSH not inserted
  75.  "df3:animals/birds/robin",$0    
  76.  
  77.  
  78. IMPORTANT:-
  79. -----------
  80.  
  81. After you've finished loading a batch of files (or just one) you should shut
  82. down the drive. Call "MOTOR_OFF" 
  83.  
  84. I did not make this automatic as it would have meant stopping and restarting
  85. the motor needlessly and wasting time waiting for the motor to reach the
  86. right speed between each file. The motor will only be left running (ready
  87. for next file) if there has not been any error report! The code will always
  88. sense if the motor needs to be restarted and will perform this task.
  89.  
  90. GENERAL INFO
  91. ------------
  92.  
  93. The loader contains thorough error checking and should not lock up.
  94. You can even eject a disk whilst loading and it will return an error as
  95. normal! I've tested it on A500-A1200 with no problems - Timing is made
  96. using CIAB timer b so CPU speed will make NO difference - It doesnt
  97. generate any interrupts, lock out any interrupts or use the blitter!
  98. The code is obviously not designed to multitask so make sure you knock
  99. out the system IRQs when testing. You can run your own interrupts whilst
  100. loading takes place (EG: copper, VBL etc-but be careful if any of your
  101. code uses the cia's!)
  102.  
  103. The example call on the source returns to dos after completion, this is
  104. only for test purposes.. DO NOT attempts any normal dos disk activity cus
  105. the Amiga will not realize that the heads have been shifted etc and it
  106. probably will corrupt your disk(s).. Also the example calls have a large
  107. load buffer for testing (128k) so dont be put off by the executable file
  108. size!
  109.  
  110. Abrieviated info also contained at the start of the source code together
  111. with an example load call. For simple single disk loading see the the
  112. source and docs for "FileLoader".
  113.  
  114. -----------------------------------------------------------------------------
  115.  
  116. QUICK EXAMPLE OF USE:
  117.  
  118.     move.w #$4000,$dff09a    ;Disable Irqs
  119.  
  120.     jsr INIT_DISK        ;set up
  121.     
  122.     moveq #0,d7        ;actual load please
  123. GO    move.l #$c0000,a5        ;load address
  124.     move.l #filname,a6        ;file name address
  125.  
  126.     jsr LOAD_FILE
  127.     tst.w d7            ;how did it go?
  128.     beq.s LOAD_OK
  129.  
  130.      bsr SHOW_REPORT        ;YOUR ROUTINE!  
  131.     
  132. LOAD_OK    jsr MOTOR_OFF
  133.     move.w #$c000,$dff09a
  134.     rts
  135.  
  136. Filename dc.b "GardeningDisk:Vegetables/Cabbage",$0
  137.  
  138. -------------------------------------------------------------------------------
  139.  
  140.